<html><head>

        <title>Formulir Data Penduduk</title> 
        <link href="<?php echo base_url('assets/css/formpenduduk.css'); ?>" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url('assets/js/jquery-ui.css'); ?>" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="<?php echo base_url('assets/js/jquery-1.9.1.js'); ?>"></script>
        <script type="text/javascript" src="<?php echo base_url('assets/js/jquery-ui.js'); ?>"></script>

        <style type="text/css">
            <!--
            .style1 {color: #F0F0F0}
            .style2 {font-size: 24px}
            -->
        </style>
        <script type="text/javascript">
            $(function() {
                $("#tgl_lahir").datepicker({changeMonth: true, changeYear: true});
            });
        </script>
    </head>
    <body>
        <form action="<?php echo base_url('penduduk/simpan_ubah'); ?>" method="post">
<!--            <input type="hidden" name="nik" value="<?php //echo $data_penduduk->nik; ?>">-->
            <table width="715" border="0" align="center">
                <tr>
                    <td colspan="8" class="trheader"><strong>Formulir Data Penduduk</strong></td>
                </tr>
                <tr>
                    <td colspan="8" class="jeda"><strong>Data Personal Penduduk </strong></td>
                </tr>
                <tr>
                    <td width="121">NIK</td>
                    <td colspan="3"><input type="text" name="nik" id="nik" class="textinput" value="<?php echo $data_penduduk->nik; ?>"/></td>
                    <td width="5">&nbsp;</td>
                    <td width="147">Nama</td>
                    <td width="196" colspan="2"><input type="text" name="nama" id="nama" class="textinput" value="<?php echo $data_penduduk->nama; ?>" /></td>
                </tr>
                <tr>
                    <td>Tempat Lahir</td>
                    <td colspan="3"><input type="text" name="tempat_lahir" id="tempat_lahir" class="textinput" value="<?php echo $data_penduduk->tempat_lahir; ?>"/></td>
                    <td>&nbsp;</td>
                    <td>Tanggal Lahir</td>
                    <td colspan="2">&nbsp;&nbsp;&nbsp;<input type="text" name="tgl_lahir" class="textinput" id="tgl_lahir" value="<?php echo $data_penduduk->tgl_lahir; ?>"/></td>
                </tr>
                <tr>
                    <td>Jenis Kelamin</td>
                    <td colspan="3"><select name="idjenis_kelamin" class="list">
                            <?php
                            if (isset($jenis_kelamin)) {
                                foreach ($jenis_kelamin->result() as $data_jenis_kelamin) {
                                    echo '<option class="radiobutton" value="' . $data_jenis_kelamin->idjenis_kelamin . '">' . $data_jenis_kelamin->jenis_kelamin . '</option>';
                                }
                            }
                            ?>
                        </select>                  </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>Pendidikan Akhir</td>
                    <td colspan="3"><select name="idpendidikan" class="list">
                            <?php
                            if (isset($pendidikan)) {
                                foreach ($pendidikan->result() as $data_pendidikan) {
                                    echo '<option value="' . $data_pendidikan->idpendidikan . '">' . $data_pendidikan->pendidikan . '</option>';
                                }
                            }
                            ?>
                        </select></td>
                    <td>&nbsp;</td>
                    <td>Golongan darah</td>
                    <td colspan="2"><select name="idgol_darah" id="idgol_darah" class="list">
                            <?php
                            if (isset($gol_darah)) {
                                foreach ($gol_darah->result() as $data_gol_darah) {
                                    echo '<option value="' . $data_gol_darah->idgol_darah . '">' . $data_gol_darah->gol_darah . '</option>';
                                }
                            }
                            ?>
                        </select></td>
                </tr>
                <tr>
                    <td>Agama</td>
                    <td colspan="3"><select name="idagama" id="idagama" class="list">
                            <?php
                            if (isset($agama)) {
                                foreach ($agama->result() as $data_agama) {
                                    echo '<option value="' . $data_agama->idagama . '">' . $data_agama->agama . '</option>';
                                }
                            }
                            ?>
                        </select></td>
                    <td>&nbsp;</td>
                    <td>Pekerjaan</td>
                    <td colspan="2"><select name="idpekerjaan" id="idpekerjaan" class="list">
                            <?php
                            if (isset($pekerjaan)) {
                                foreach ($pekerjaan->result() as $data_pekerjaan) {
                                    echo '<option value="' . $data_pekerjaan->idpekerjaan . '">' . $data_pekerjaan->pekerjaan . '</option>';
                                }
                            }
                            ?>
                        </select></td>
                </tr>
                <tr>
                    <td>Kewarganegaraan</td>
                    <td colspan="3"><select name="idkewarganegaraan" id="idkewarganegaraan" class="list">
                            <?php
                            if (isset($kewarganegaraan)) {
                                foreach ($kewarganegaraan->result() as $data_kewarganegaraan) {
                                    echo '<option value="' . $data_kewarganegaraan->idkewarganegaraan . '">' . $data_kewarganegaraan->kewarganegaraan . '</option>';
                                }
                            }
                            ?>
                        </select></td>
                    <td>&nbsp;</td>
                    <td>Keturunan</td>
                    <td colspan="2"><input type="text" name="keturunan" id="keturunan" class="textinput" value="<?php echo $data_penduduk->keturunan; ?>" /></td>
                </tr>
                <tr>
                    <td>Status Perkawinan</td>
                    <td colspan="3"><select name="idstatus_kawin" id="idstatus_kawin" class="list">
                            <?php
                            if (isset($status_kawin)) {
                                foreach ($status_kawin->result() as $data_status_kawin) {
                                    echo '<option value="' . $data_status_kawin->idstatus_kawin . '">' . $data_status_kawin->status_kawin . '</option>';
                                }
                            }
                            ?>
                        </select></td>
                    <td>&nbsp;</td>
                    <td> Status dalam Keluarga</td>
                    <td colspan="2"><select name="idstatus_keluarga" class="list" id="idstatus_keluarga">
                      <?php
                            if (isset($status_keluarga)) {
                                foreach ($status_keluarga->result() as $data_status_keluarga) {
                                    echo '<option value="' . $data_status_keluarga->idstatus_keluarga . '">' . $data_status_keluarga->status_keluarga . '</option>';
                                }
                            }
                            ?>
                    </select></td>
              </tr>
                <tr>
                    <td>Status Menetap</td>
                    <td colspan="3">
                        <select name="status" id="status" class="list">
                        <?php
                            $status = $_POST[nik];
                            //form ubah level
                            if ($status > 0) {
                                ?>
                                <option value="<?php echo $data_penduduk->status; ?>"><?php echo $data_penduduk->status; ?></option>
                            <?php } ?>
                            <option value="1">Aktif</option>
                            <option value="0">Non-aktif</option>
                        </select></td>
                    <td>&nbsp;</td>
                    <td>Telp</td>
                    <td colspan="2"><input type="text" name="telp" id="telp" class="textinput" value="<?php echo $data_penduduk->telp; ?>"/></td>
                </tr>
                <tr>
                    <td>Nama Ayah</td>
                    <td colspan="3"><input type="text" name="nama_ayah" id="nama_ayah" class="textinput" value="<?php echo $data_penduduk->nama_ayah; ?>"/></td>
                    <td>&nbsp;</td>
                    <td>Nama Ibu</td>
                    <td colspan="2"><input type="text" name="nama_ibu" id="nama_ibu" class="textinput" value="<?php echo $data_penduduk->nama_ibu; ?>"/></td>
                </tr>
                <tr>
                    <td colspan="8">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="8" class="jeda"><strong>Data Dokumen Penduduk</strong></td>
                </tr>
                <tr>
                    <td>No. Kartu Keluarga</td>
                    <td colspan="3"><input type="text" name="no_kk" id="no_kk" class="textinput" value="<?php echo $data_penduduk->no_kk; ?>"/></td>
                    <td>&nbsp;</td>
                    <td>No. Surat Nikah</td>
                    <td colspan="2"><input type="text" name="no_suratnikah" id="no_suratnikah" class="textinput" value="<?php echo $data_penduduk->no_suratnikah; ?>"/></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="3">&nbsp;&nbsp;&nbsp;<input type="button" name="carikk" id="carikk" value="Cari Data KK" class="radiobutton-kiri"/></td>
                    <td>&nbsp;</td>
                    <td>Tanggal Nikah</td>
                    <td colspan="2"><input type="text" name="tgl_suratnikah" id="tgl_suratnikah" class="textinput" value="<?php echo $data_penduduk->tgl_suratnikah; ?>"/></td>
                </tr>
                <tr>
                    <td>No. Paspor</td>
                    <td colspan="3"><input type="text" name="no_passpor" id="no_passpor" class="textinput" value="<?php echo $data_penduduk->no_passpor; ?>"/></td>
                    <td>&nbsp;</td>
                    <td>No. Surat Cerai</td>
                    <td colspan="2"><input type="text" name="no_suratcerai" id="no_suratcerai" class="textinput" value="<?php echo $data_penduduk->no_suratcerai; ?>"/></td>
                </tr>
                <tr>
                    <td>No. Kitas</td>
                    <td colspan="3"><input type="text" name="no_kitas" id="no_kitas" class="textinput" value="<?php echo $data_penduduk->no_kitas; ?>"/></td>
                    <td>&nbsp;</td>
                    <td>Tanggal Cerai</td>
                    <td colspan="2"><input type="text" name="tgl_suratcerai" id="tgl_suratcerai" class="textinput" value="<?php echo $data_penduduk->tgl_suratcerai; ?>"/></td>
                </tr>
                <tr>
                    <td colspan="8">&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td><input type="submit" name="ubah" id="ubah" value="Ubah" class="btn btn-large""/></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
    </form>
    </body>
</html>
